<!DOCTYPE html>
<html lang="en" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"  xmlns:th="http://www.thymeleaf.org">
<head>

    <head th:replace="/common/head :: head"></head>

</head>
<body>
<!-- START PAGE CONTAINER -->
<div class="page-container">

    <!-- START PAGE SIDEBAR -->
    <div class="page-sidebar">
        <!-- START X-NAVIGATION -->
        <div th:replace="/common/left :: left"></div>
        <!-- END X-NAVIGATION -->
    </div>
    <!-- END PAGE SIDEBAR -->

    <!-- PAGE CONTENT -->
    <div class="page-content">

        <div th:replace="/common/top :: top"/>

        <!-- START BREADCRUMB -->
        <ul class="breadcrumb">
            <li><a href="#">Home</a></li>
            <li><a href="#">模板管理</a></li>
            <li class="active">模板列表</li>
        </ul>
        <!-- END BREADCRUMB -->

        <!-- PAGE CONTENT WRAPPER -->
        <div class="page-content-wrap">


            <div class="row">
                <div class="col-md-12">

                    <!-- START DATATABLE EXPORT -->
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title">模板列表</h3>
                            <div class="pull-right">
                                <!--<div class="btn-group">
                                    <button class="btn btn-success dropdown-toggle btn-condensed" data-target='#userInfoAddModal' data-toggle='modal'><i
                                            class="fa fa-plus"></i></button>
                                </div>
                                <div class="btn-group">
                                    <button type="button" class="btn btn-default panel-collapse btn-condensed">
                                        <i class="fa fa-caret-up"></i>
                                    </button>
                                </div>-->
                            </div>
                        </div>
                        <div class="panel-heading" style="float: right;">
                            <div class="btn-group">
                                <button type="button" class="btn btn-success dropdown-toggle"
                                        onclick="add()">
                                    <span class="glyphicon glyphicon-plus"></span>新增
                                </button>
                            </div>
                            <div class="pull-right" style="">
                                <label>应用选择:</label>
                                <div class="btn-group" style="width:200px;">
                                    <select name="appName" class="form-control" id="appName" aria-required="true">

                                    </select>
                                </div>
                                <div class="btn-group">
                                    <button type="button" class="btn btn-success dropdown-toggle"
                                            onclick="loadData()">
                                        <span class="glyphicon glyphicon-search"></span>查询
                                    </button>
                                </div>
                            </div>
                        </div>

                        <div class="panel-body">
                            <div class="table-responsive">
                                <table id="dataTables-userInfo" class="table table-bordered">
                                    <thead>
                                    <tr>
                                        <th>示例图</th>
                                        <th>模板key</th>
                                        <th>应用名称</th>
                                        <th>模板名称</th>
                                        <th>模板描述</th>
                                        <th>创建时间</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                </table>
                            </div>
                        </div>
                    </div>
                    <!-- END DATATABLE EXPORT -->

                </div>
            </div>

        </div>
        <!-- END PAGE CONTENT WRAPPER -->
    </div>
    <!-- END PAGE CONTENT -->
</div>
<!-- END PAGE CONTAINER -->

<div id="toolbar">

</div>

<div class="modal fade" id="userInfoDelModal" tabindex="-1" role="dialog"
     aria-labelledby="userInfoDelModalLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title" id="userInfoDelModalLabel">删除认证</h4>
            </div>
            <div class="modal-body">
                <input id="delId" type="hidden">
                确定要删除么？
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" onclick="userInfoDel()">删除</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="editModal" tabindex="-1" role="dialog"
     aria-labelledby="userInfoEditModalLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title" id="userInfoEditModalLabel">修改</h4>
            </div>
            <div class="modal-body">
                <form id="userInfoEditForm">
                    <input type="hidden" id="templateId"  name="id"/>
                    <div class="form-group form-group-30" >
                        <div  class="form-text-right"><span style="color: red;">*</span>模板key</div>
                        <div class="col-sm-8">
                            <input name="templateKey" class="form-control" placeholder="5~30位字母  格式banner.feedback" type="text"
                                   id="editTemplateKey" aria-required="true"/>
                        </div>
                    </div>
                    <div class="form-group form-group-30" >
                        <div  class="form-text-right"><span style="color: red;">*</span>应用</div>
                        <div class="col-sm-8">
                            <input name="appName" class="form-control"  type="text" id="editAppName" aria-required="true"/>
                        </div>
                    </div>
                    <div class="form-group form-group-30" >
                        <div  class="form-text-right"><span style="color: red;">*</span>模板名称</div>
                        <div class="col-sm-8">
                            <input name="templateName" class="form-control" placeholder="请输入模板名称" type="text"
                                   id="editTemplateName" aria-required="true"/>
                        </div>
                    </div>
                    <div class="form-group form-group-30" style="height: 54px;" >
                        <div  class="form-text-right"><span style="color: red;"></span>模板描述</div>
                        <div class="col-sm-8">
                            <textarea name="templateDesc" class="form-control" style="height: 54px" placeholder="请输入模板描述" type="text"
                                      id="editTemplateDesc" aria-required="true"></textarea>
                        </div>
                    </div>
                    <div class="form-group form-group-30" >
                        <div  class="form-text-right"><span style="color: red;"></span>示例图</div>
                        <div class="col-sm-8">
                            <input class="form-control" name="templateUrl" id="editTemplateUrl" />
                        </div>
                    </div>

                    <input name="id"  type="hidden" id="id" aria-required="true"/>
                    <input type="reset" name="editReset" style="display: none;"/>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" onclick="userInfoEdit()">修改</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="addModal" tabindex="-1" role="dialog"
     aria-labelledby="userInfoAddModalLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title" id="userInfoAddModalLabel">新增</h4>
            </div>
            <div class="modal-body">
                <form id="templateAddForm">
                    <div class="form-group form-group-30" >
                        <div  class="form-text-right"><span style="color: red;">*</span>模板名称</div>
                        <div class="col-sm-8">
                            <input name="templateName" class="form-control" placeholder="请输入模板名称" type="text"
                                   id="addTemplateName" aria-required="true"/>
                        </div>
                    </div>

                    <div class="form-group form-group-30" >
                        <div  class="form-text-right"><span style="color: red;">*</span>模板key</div>
                        <div class="col-sm-8">
                            <input name="templateKey" class="form-control" placeholder="不支持修改key" type="text"
                                   id="addTemplateKey" aria-required="true"/>
                        </div>
                    </div>

                    <div class="form-group form-group-30" >
                        <div  class="form-text-right"><span style="color: red;">*</span>应用</div>
                        <div class="col-sm-8">
                            <select name="appName" class="form-control" id="addAppName" style="width: 100%;">

                            </select>
                        </div>
                    </div>
                    <div class="form-group form-group-30"  style="height: 54px;" >
                        <div  class="form-text-right"><span style="color: red;"></span>模板描述</div>
                        <div class="col-sm-8">
                            <textarea name="templateDesc" class="form-control" style="height: 54px" placeholder="请输入模板描述" type="text"
                                      id="addTemplateDesc" aria-required="true"></textarea>
                        </div>
                    </div>
                    <div class="form-group form-group-30" >
                        <div  class="form-text-right"><span style="color: red;"></span>示例图</div>
                        <div class="col-sm-8">
                            <input class="form-control" name="templateUrl" id="addTemplateUrl" />
                        </div>
                    </div>


                    <input type="reset" name="addReset" style="display: none;"/>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" onclick="addTemplate()">新建</button>
            </div>
        </div>
    </div>
</div>
<div id="Layer1" style="display: none; position: absolute; z-index: 100;"/>

<div th:replace="/common/footer :: footer"/>

<script type="text/javascript" th:src="@{/js/admin/template.js}"></script>

</body>
</html>






